/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.dao;

import org.ipti.br.tag.entity.UnityHolidayCalendar;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.ipti.br.tag.util.EncryptionUtil;

/**
 *
 * @author israel
 */
@Stateless
public class UnityHolidayCalendarFacade extends AbstractFacade<UnityHolidayCalendar> {

    @PersistenceContext(unitName = "TAG2PU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public UnityHolidayCalendarFacade() {
        super(UnityHolidayCalendar.class);
    }

    @Override
    public void create(UnityHolidayCalendar unityHolidayCalendar) {
        getEntityManager().persist(unityHolidayCalendar);
    }

    @Override
    public void edit(UnityHolidayCalendar unityHolidayCalendar) {
        unityHolidayCalendar.setSerialNumber(null);

        getEntityManager().merge(unityHolidayCalendar);
    }

    public void editForSynchronization(UnityHolidayCalendar unityHolidayCalendar) {
        getEntityManager().merge(unityHolidayCalendar);
    }
}
